<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // js事件循环机制的笔试题
      setTimeout(()=>{
    console.log('A');
    },0);
    var obj={
      func:function () {
        setTimeout(function () {
            console.log('B')
        },0);
        return new Promise(function (resolve) {
            console.log('C');
            resolve();
        })
     }
  };

obj.func().then(function () {
    console.log('D')
});
console.log('E');

  </script>
</body>
</html>